﻿@using Presentation.Web.Admin
@model Domain.Dto.MvcControllerDto
@{
    ViewBag.subtitle = "控制器信息";
    ViewBag.title = "控制器信息";
    Layout = "~/Views/Shared/_Layout.cshtml";

    var controllerClassService = Presentation.Web.Admin.PreAdminEngine
        .Resolve<Infrastructure.Crosscutting.Authorize.IMvcControllerClassService>();
    var controllerClass = controllerClassService.GetList().OrderByDescending(e => e.Id)
            .ThenByDescending(e => e.AddTime);
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jshelper.js")" type="text/javascript"></script>
@using (Ajax.BeginForm("controllerinfo", "permission", new AjaxOptions()
{
    HttpMethod = "post",
    OnFailure = "AjaxOptionsEditFailure",
    OnSuccess = "AjaxOptionsEditSuccess"
}))
{
    @Html.ValidationSummary(true)
    <fieldset class="module width_full">
        <legend></legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.ClassId)
        </div>
        <div class="editor-field">
            <select id="ClassId" name="ClassId">
                <option value="0">-----请选择----</option>
                @{
    foreach (var item in controllerClass)
    {
                    <option value = "@(item.Id)" @(item.Id == Model.ClassId ? "selected='selected'" : "") >@(item.Name)</option>
    }
                }
            </select>
            @Html.ValidationMessageFor(model => model.ClassId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.AssemblyFullName)
        </div>
        <div class="editor-field">
            @Html.TextBox("AssemblyFullName", Model.AssemblyFullName, new { @readonly = true })
            @Html.ValidationMessageFor(model => model.AssemblyFullName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.TextBox("Name", Model.Name, new { @readonly = true })
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Remark)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remark)
            @Html.ValidationMessageFor(model => model.Remark)
        </div>
        <div style="display: none;">
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model => model.State)
            @Html.HiddenFor(model => model.SortNum)
            @Html.HiddenFor(model => model.AddTime)
            @Html.HiddenFor(model => model.IpAddress)
        </div>
    </fieldset>
    <p>
        @{
    if (Html.HasUiPermission(this.ViewContext, "controllerinfo"))
    {
            <input type="submit" value="修改" class="alt_btn module_margin" />
            @Html.GoBackPre("t-button")
    }
        }
    </p>
}
